<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    let Father = function (uname, age) {
      this.uname = uname;
      this.age = age;
    };
    Father.prototype.money = function () {
      console.log(this);
    };
    let Son = function (uname, age, score) {
      Father.call(this, uname, age);
      this.score = score;
    };
    Son.prototype = new Father(); //创建一个实例对象
    Son.prototype.constructor = Son; //让构造器指回Son构造函数
    Son.prototype.exam = function () {
      console.log(`这是孩子的事情了`);
    };
    let ldu = new Son();
    console.log(ldu);
    console.log(Father.prototype);
  </script>
</body>

</html>